//用户相关的操作业务的网络请求
import request from '../utils/request.js'
//登录
export const userLoginApi= async (payload)=>{
    return await request.get('/users',{
        params:payload
    })
}

//分配账号
export const userRegisterApi=  (payload)=>{
    return  request.post('/users',payload)
}

//更新用户信息
export const userUpdateUApi= (id,payload)=>{
    return request.put('/users',payload,{
        params:{
            id 
        }
    })
}

//权限管理,角色新增
export const rolePostApi= (payload)=>{
    return  request.post('/role',payload)
}

//角色列表
export const roleGetApi=  (roleId)=>{
    let params=roleId?{'id':roleId}:{}
    return request.get('/role',{
        params
    })
}
//角色删除
export const roleDelApi= async (id)=>{
    return await request.delete('/role',{
        params:{
            id
        }
    })
}

//角色更新
export const roleUpdateApi=  (payload,id)=>{
    return request.put('/role',payload,
        {
            params:{
                id 
            }
        }
    )
}
